﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using GTR.News.AdminModel;


namespace GTR.News.AdminDAL
{
    public class PictureDAL
    {

        /// <summary>
        /// 图片显示
        /// </summary>
        /// <returns></returns>
        public DataTable picSHOW()
        {
            return DBhelper.GetTable("select * from picture");
        }
        /// <summary>
        /// 图片添加
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public int picADD(Picture p)
        {
            return DBhelper.NonQuery("insert into picture values('" + p.Title + "','" + p.Picture_url + "','" + p.PictureDate + "','" + p.NewsID + "')");

        }
        /// <summary>
        /// 图片删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int PictureDEL(int id)
        {
            return DBhelper.NonQuery("delete from Picture where PictureID=" + id);
        }




    }
}
